#parse('include.vm')
#set($TYPE = $model.name)
#set($type = $CSU.getVariable($TYPE))
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<title>#label($model)</title>
	<link rel="stylesheet" type="text/css" href="../css/simple.css" charset="utf-8" />
	<script src="../jcx/1/full.js" charset="utf-8"></script>
	<script src="${TYPE}.js" charset="utf-8"></script>
</head>

<body>
<h3>#label($model)</h3>
<div align="center">
	<form id="searchForm">
		#allConditions($model)
		&nbsp;&nbsp;<a id="btn_search">搜索</a>
	</form>
</div>
<div style="margin-top:20px">
	<a id="${TYPE}AddBtn" class="fl">添加</a>
	<a id="${TYPE}DelBtn" class="fr">删除选中</a>
</div>
<table id="${TYPE}Table" border="1">

<thead>
  <tr>
  <th><input type="checkbox" id="checkboxAll" /></th>
  #*列标题*#
#foreach($field in $MU.findAllField($model))
#set($mtm = false)
#set($mtm = $MU.getElementMtm($field))
#set($isTransient = false)
#set($isTransient = $field.isTransient)
#if(!$mtm && !$isTransient)
	<th>#label($field)</th>
#end
#end

#set($mtmList = $MU.getModelMtmList($model))

#foreach($mtm in $mtmList)
	#set($md2 = $CONTEXT.findModel($mtm.anotherModel))
	<th>$md2.label</th>
#end

	<th>&nbsp;</th>
	<th>&nbsp;</th>
  </tr>
</thead>

#*列数据*#
<tbody>
  <tr id="row_template">
	<td><input type="checkbox" name="checkbox" value="" /></td>
#foreach($field in $MU.findAllField($model))
#set($mtm=false)
#set($mtm = $MU.getElementMtm($field))
#set($isTransient = false)
#set($isTransient = $field.isTransient)
#if(!$mtm && !$isTransient)
	<td>${field.name}</td>
#end
#end

#foreach($mtm in $mtmList)
	<td><a class="setup">设置</a></td>
#end

	<td><a class="edit">编辑</a></td>
	<td><a class="del">删除</a></td>
  </tr>
</tbody>
</table>

<br/>

<table border="1">
  <tr>
    <td id="page">

    </td>
  </tr>
</table>

<div id="$!{TYPE}EditPanel" style="display:none">
  <form id="$!{TYPE}EditForm" name="$!{TYPE}EditForm">
    <table border="1">
    #set($type=$CSU.getVariable($model.name))
	#foreach($field in $MU.findAllField($model))
	 #if(!$field.isTransient && $field.attributes.editable!='no')
      <tr>
        <td class="tac">#label($field)</td>
        <td>#input($field, false)</td>
        <td>&nbsp;</td>
      </tr>
	  #end
	#end
      <tr>
        <td>&nbsp;</td>
        <td>
			<input id="${TYPE}SaveBtn" type="button" value="提交" />
			</td>
        <td>&nbsp;</td>
      </tr>
    </table>
  </form>
</div>

</body>
</html>
